]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
main: Guard against NULL log_domain in default handler
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 26 Oct 2012 16:52:07 +0000 (18:52 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 22 Feb 2013 10:02:00 +0000 (11:02 +0100)
g_str_has_prefix() will assert when passed NULL, so we need to make
sure that we are passed a non-NULL log_domain first.

Spotted by <goughost<at>yahoo.com.cn>

https://bugzilla.gnome.org/show_bug.cgi?id=663601

src/main.c

index 8e805a627930074de2e66b7d8f783132db15812a..ca2116a9613285e86388915eac071342893c4739 100644 (file)
@@ -284,7 +284,7 @@ default_log_handler (const char     *log_domain,
 
   /* Filter out telepathy-glib logs, we don't want to flood Shell's output
    * with those. */
-  if (!g_str_has_prefix (log_domain, "tp-glib"))
+  if (!log_domain || !g_str_has_prefix (log_domain, "tp-glib"))
     g_log_default_handler (log_domain, log_level, message, data);
 }